package main

import (
	"day12_11_homework/config"
	_ "day12_11_homework/init"
	"day12_11_homework/internal/router"
	"day12_11_homework/internal/validate"
	"github.com/gin-gonic/gin"
	"github.com/gin-gonic/gin/binding"
	"github.com/go-playground/validator/v10"
)

func main() {
	r := gin.Default()

	if v, ok := binding.Validator.Engine().(*validator.Validate); ok {
		v.RegisterValidation("ModelValidate", validate.ModelValidate)
	}

	router.Router(r)
	r.Run(":" + config.Configs.SyStem.Port)
}
